<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="../../core/include.inc.jsp"%>
<script type="text/javascript">
  //重置
  $(".socialInfo-list-reset-button").click(function(){
    $(".socialInfo-list-div input[name='nickname']").val("");
    $(".socialInfo_list_page_form input[name='nickname']").val("");
    $(".socialInfo-list-div select[name='blockId']").val("-1");
    $(".socialInfo_list_page_form input[name='blockId']").val("");
    $(".socialInfo-list-div select[name='status']").val("-1");
    $(".socialInfo_list_page_form input[name='status']").val("");
    $(".socialInfo_list_page_form").submit();
  })
  //查询
  $(".socialInfo-list-search-button").click(function(){

    var nickname = $(".socialInfo-list-div input[name='nickname']").val().trim();
    $(".socialInfo_list_page_form input[name='nickname']").val(nickname);

    var blockId = $(".socialInfo-list-div select[name='blockId']").val();
    if( blockId != -1 ){
      $(".socialInfo_list_page_form input[name='blockId']").val(blockId);
    }

    var status = $(".socialInfo-list-div select[name='status']").val();
    if( status != -1 ){
      $(".socialInfo_list_page_form input[name='status']").val(status);
    }
    $(".socialInfo_list_page_form").submit();
  })

  $(".deal_community_socialInfo").click(function(){
    var id = "";
      $(".socialInfo-list").each(function(i,j){
          if( $(j).hasClass("selected") ){
            id = "1";
            if( $(j).attr("info") == 1 ){
              alertMsg.warn('不需要处理！')
              return;
            }
            if( $(j).attr("info") == 0 ){
              $(".deal_community_socialInfo_hide").click();
              return;
            }
          }
      })
    if( id == "" ){
      alertMsg.warn('请选择一条记录！')
    }
  })
</script>
<%--表单区域--%>
<form id="pagerForm" onsubmit="return navTabSearch(this);" method="post" action="community_socialInfo_list" class="socialInfo_list_page_form">
  <input type="hidden" name="pageNum" value="${pageModel.pageNum}" />
  <input type="hidden" name="numPerPage" value="${pageModel.numPerPage}" />
  <input type="hidden" name="blockId" value="${blockId}" />
  <input type="hidden" name="status" value="${status}" />
  <input type="hidden" name="nickname" value="${nickname}" />
</form>

<div class="pageHeader">
  <div class="searchBar">
    <ul class="searchContent socialInfo-list-div">
      小区名称
      <select name="blockId">
        <option value="-1">--选择小区--</option>
        <c:forEach var="block" items="${blocks}">
          <option value="${block.id}" <c:if test="${block.id == blockId }">selected="selected" </c:if> >${block.blockName}</option>
        </c:forEach>
      </select>
      &nbsp;&nbsp;
      用户昵称
      <input type="text" name="nickname" value="${nickname}" class="textInput" placeholder="请输入用户昵称" />
      &nbsp;&nbsp;
      状态
      <select name="status">
        <option value="-1" <c:if test="${empty status}">selected="selected" </c:if> >--选择状态--</option>
        <option value="0" <c:if test="${!empty status && status == 0}">selected="selected" </c:if> >待处理</option>
        <option value="1" <c:if test="${!empty status && status == 1}">selected="selected" </c:if> >已处理</option>
      </select>
      &nbsp;&nbsp;
      <input type="button" value="查询" class="socialInfo-list-search-button" />
      &nbsp;&nbsp;
      <input type="button" value="重置" class="socialInfo-list-reset-button" />
    </ul>
  </div>
</div>
<div class="pageContent">
  <div class="panelBar">
    <ul class="toolBar">
      <li>
        <div style="display: none;">
          <a href="to_edit_community_socialInfo?id={socialInfo_id}" class="deal_community_socialInfo_hide" target="dialog" width="400" height="200" mask="true"></a>
        </div>
        <a class="edit deal_community_socialInfo">
          <span>处理</span>
        </a>
      </li>
      <li class="line">line</li>
      <li>
        <a class="delete" href="delete_community_socialInfo?id={socialInfo_id}" target="ajaxTodo" title="确定要删除吗?">
          <span>删除</span>
        </a>
      </li>
      <li class="line">line</li>
      <li>
        <a class="edit" href="to_detail_community_socialInfo?id={socialInfo_id}" target="dialog" width="600" height="400" >
          <span>查看详情</span>
        </a>
      </li>
      <li class="line">line</li>
      <li>
        <a class="add" href="to_add_remark_community_socialInfo?id={socialInfo_id}" target="dialog" width="600" height="400" >
          <span>添加备注</span>
        </a>
      </li>
      <li class="line">line</li>
    </ul>
  </div>
  <table class="table" width="100%" layoutH="110">
    <thead>
    <tr>
      <th>序号</th>
      <th>小区名称</th>
      <th>用户账号</th>
      <th>联系电话</th>
      <th>意向</th>
      <th>状态</th>
      <th>处理时间</th>
      <th>创建时间</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach var="socialInfo" items="${socialInfos}" varStatus="st">
      <tr target="socialInfo_id" rel="${socialInfo.id}" class="socialInfo-list" info="${socialInfo.status}">
        <td>${st.index+1}</td>
        <td>${socialInfo.blockName}</td>
        <td>${socialInfo.nickname}</td>
        <td>${socialInfo.userMobile}</td>
        <td>${socialInfo.showIntention}</td>
        <td>${socialInfo.statusStr}</td>
        <td>
          <fmt:formatDate value="${socialInfo.dealTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
        </td>
        <td>
          <fmt:formatDate value="${socialInfo.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
        </td>
      </tr>
    </c:forEach>
    </tbody>
  </table>
  <c:import url="../../core/pagebar.inc.jsp" />
</div>



